package com.yz.forlogin.system.repository;

import com.yz.forlogin.security.entity.Admin;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.Optional;

/**
 * @author 钰杰
 * @className AdminRepository
 * @description VX:FengYJ996
 * @date 2020/1/1014:29
 */
@Repository
public interface AdminRepository extends JpaRepository<Admin,Integer> {

    @Query(nativeQuery = true,value = "select * from tb_admin where username=?1")
    Optional<Admin> findByUsername(String username);
}
